#ifndef OPCODE_HPP
#define OPCODE_HPP

#define UNARY_NOT	    12

#define BINARY_MUL      20
#define BINARY_DIV      21
#define BINARY_MOD      22
#define BINARY_ADD	    23
#define BINARY_SUB      24
#define BINARY_SUBSCR	25

#define STORE_SUBSCR    60

#define BINARY_LSHIFT	62
#define BINARY_RSHIFT	63
#define BINARY_AND	    64
#define BINARY_XOR	    65
#define BINARY_OR	    66

#define PRINT_ITEM      71
#define PRINT_NEWLINE   72

#define RETURN_VALUE    83
#define POP_BLOCK	    87

#define HAVE_ARGUMENT	90	/* Opcodes from here have an argument: */

#define STORE_NAME	90	/* Index in name list */
#define LOAD_CONST	100	/* Index in const list */
#define LOAD_NAME	101	/* Index in name list */

#define BUILD_TUPLE 102
#define BUILD_LIST	103	/* Number of list items */

#define COMPARE_OP	107	/* Comparison operator */

#define JUMP_FORWARD	110	/* Number of bytes to skip */
#define JUMP_ABSOLUTE	113	/* "" */
#define POP_JUMP_IF_FALSE 114	/* "" */

#define SETUP_LOOP	120	/* Target address (relative) */
#define LOAD_FAST       124
#define STORE_FAST      125

#define CALL_FUNCTION   131
#define MAKE_FUNCTION   132

#define MAKE_CLOSURE    134
#define LOAD_CLOSURE    135
#define LOAD_DEREF      136
#define STORE_DEREF     137


enum COMPARE {
    LESS = 0,
    LESS_EQUAL,
    EQUAL,
    NOT_EQUAL,
    GREATER,
    GREATER_EQUAL
};

#endif
